package com.xyw.code.study20200813.test;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/9/1
 * Time: 上午9:40
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
public class ThreadTest2 implements Runnable {
    public String name;
    public ThreadTest2(String name) {
        this.name = name;
    }
    @Override
    public void run() {
        for(int i=0;i<10;i++){
            System.out.println(name+"运行,i="+i);
        }
    }

    public static void main(String[] args) {
        ThreadTest2 threadTest1 = new ThreadTest2("测试1");
        ThreadTest2 threadTest2 = new ThreadTest2("测试2");
        Thread t1 = new Thread(threadTest1) ;
        Thread t2 = new Thread(threadTest2) ;

        t1.start();t2.start();
    }
}
